<?php if (!defined('THINK_PATH')) exit();?><div style="width:700px;height:400px;padding:10px;margin:30px auto;">
    <div class="easyui-panel" title="">
        <form id="webset" method="post">
            <table cellpadding="5" style="margin:30px auto;">
                <tr>
                    <td>网站名称:</td>
                    <td>
                        <input class="easyui-textbox" type="text" name="webname" data-options="prompt:'网站名称'" style="width:240px;"
                               value='<?php echo ($sysConfig["WEBNAME"]); ?>'></input>
                    </td>
                </tr>
                <tr>
                    <td>是否开启注册:</td>
                    <td>
                        <select class="easyui-combobox" name="regisOn" editable="false" style="width:160px;"
                                panelHeight="auto">
                            <option value="0"
                            <?php if($sysConfig["REGIS_ON"]==0): ?>selected='selected'<?php endif; ?>
                            >开启</option>
                            <option value="1"
                            <?php if($sysConfig["REGIS_ON"]==1): ?>selected='selected'<?php endif; ?>
                            >关闭</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>版权信息:</td>
                    <td>
                        <input class="easyui-textbox" type="text" name="copy" data-options="prompt:'版权信息'" style="width:350px;"
                               value='<?php echo ($sysConfig["COPY"]); ?>'></input>
                    </td>
                </tr>
                <tr>
                    <td>过滤关键字:</td>
                    <td>
                        <input class="easyui-textbox" data-options="multiline:true,prompt:'过滤关键字'" name="keyfilter"
                               value="<?php echo ($filter); ?>"
                               style="width:350px;height:120px"></input>
                    </td>
                </tr>
            </table>
        </form>
        <div style="text-align:center;padding:5px">
            <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-save'" id="saveBtn">保存</a>
        </div>
    </div>
</div>
<script>
    $(function () {
        $('#saveBtn').bind('click',save);
    });
    function save() {
        if($.trim($('input[name=webname]').val())==""){
            $.messager.show({
                title:'系统提示',
                msg:"网站名称没有填写"
            });
            $('input[textboxname=webname]').textbox().next('span').find('input').focus();
            return;
        }

        if($.trim($('input[name=copy]').val())==""){
            $.messager.show({
                title:'系统提示',
                msg:"版权信息没有填写"
            });
            $('input[textboxname=copy]').textbox().next('span').find('input').focus();
            return;
        }
        $("#webset").ajaxSubmit({
            url: "<?php echo U('System/editConfig','','');?>",
            type: "post",
            dataType: "json",
            beforeSubmit: function (arr, $form, options) {
            },
            //提交成功后的回调函数
            success: function (result, status, xhr, $form) {
                $.messager.show({
                    title:'系统提示',
                    msg:result.msg,
                    timeout:500,
                    showType:'slide'
                });
                if(result.errorCode == 0){
                    removeTab();
                }
            },
            error: function (xhr, status, error, $form) {
            },
            complete: function (xhr, status, $form) {
            }
        });
    }
</script>